Register optimization schemas with register_strategy#885
Open
Eijebong wants to merge 1 commit intotaskcluster:mainfrom
Open
Register optimization schemas with register_strategy#885Eijebong wants to merge 1 commit intotaskcluster:mainfrom
register_strategy#885Eijebong wants to merge 1 commit intotaskcluster:mainfrom
Conversation
Contributor
Author
|
An example of what it looks after this change: Eijebong/Archipelago-index@bee7fca |
Instead of hardcoding the schema, make it part of the registration of the strategy, this allows for people to add their own strategy without having to work around `OptimizationSchema` which is painful and brittle. The slight drawback from this is that we lose the documentation in the task schema about what is possible since it's now deferred to the strategies themselves, and that we now validate optimizations twice, first to check that it's a dict then to check that it matches the strategy. Fixes taskcluster#368
d5c2724 to
cf8e2f6
Compare
register_strategyregister_strategy
bhearsum
approved these changes
Jan 2, 2026
Contributor
bhearsum
left a comment
There was a problem hiding this comment.
This looks like a very reasonable usability improvement. Even outside of the fact that it makes optimizations more extensible, it moves the schemas of the built-in optimizations to a more sensible place.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instead of hardcoding the schema, make it part of the registration of the strategy, this allows for people to add their own strategy without having to work around
OptimizationSchemawhich is painful and brittle.The slight drawback from this is that we lose the documentation in the task schema about what is possible since it's now deferred to the strategies themselves, and that we now validate optimizations twice, first to check that it's a dict then to check that it matches the strategy.
Fixes #368